package com.app.model.response;

import java.util.HashMap;
import java.util.Map;

import org.slf4j.Logger;
import org.slf4j.LoggerFactory;

/**
 * Created by Lichaojie on 2017/3/12. It's a beautiful day.
 */
public class RetCode {

    private Logger logger = LoggerFactory.getLogger(RetCode.class);
    private static Map<Integer,String> map;

    static {
        map = new HashMap<>();
        map.put(100,"成功");
        map.put(200,"错误");//数据库错误
        map.put(202,"手机号已注册");
        map.put(204,"参数解析错误");
        map.put(206,"用户名或密码错误");
        map.put(208,"token和id不一致");
        map.put(210,"token过期");
        map.put(212,"旧密码错误");
        map.put(214,"无搜索结果");
        map.put(216,"没有更多数据");
        map.put(218,"错误的参数");//提交的参数有误
        map.put(220,"搜索关键字不能为空");
        map.put(230,"当前用户已在线");
        map.put(302,"收藏夹数目过多");
        map.put(304,"收藏夹不存在");
        map.put(312,"昵称已存在");
        map.put(322,"将用户信息加入到IM服务器失败");
        map.put(324,"后台发送私信失败");
        map.put(332,"请求的用户收藏夹不存在");
        map.put(500,"服务器错误");
    }


    public static String getMessage(int code){
        return map.get(code);
    }
}
